n = int(input())
l = list()
for i in range(0,n):
    s = input().split(" ")
    l.append(s)
key = False
for i in range(0,n):
    maxl = list()
    for k in range(0,n):
        maxl.append(int(l[i][k]))
        #求行最大值
    max2 = max(maxl)
    for j in range(0,n):
        minl = list()
        for k in range(0,n):
            minl.append(int(l[k][j]))
            #求列最小值
        min2 = min(minl)
        if max2 == min2:
            print(i,j)
            key = True

if not key:
    print("NONE")